import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
# 2.输入访问地址
driver.get("http://121.43.169.97:8848/pageA.html")

# driver.set_window_size(800,600)  # 设置窗口尺寸800*600像素
# driver.set_window_position(0,500) # 将窗口移至屏幕左边0,500

driver.find_element(By.CSS_SELECTOR,"#userA").send_keys("admin")
driver.find_element(By.CSS_SELECTOR,"[name='passwordA']").send_keys("123456")
driver.find_element(By.LINK_TEXT,"百度").click()

driver.maximize_window()
time.sleep(3)
# 浏览器后退
driver.back()
time.sleep(3)
# 浏览器前进
driver.forward()
time.sleep(3)
driver.close()
# 刷新
# driver.refresh()
# 获取标题
# print(driver.title)
# 获取网页地址
# print(driver.current_url)